<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="operlog-form">
					<div class="select-list">
						<ul>
							<li>
								<label>登录名： </label><input type="text" name="userName"/>
							</li>
							<li class="select-time">
								<label>操作时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
			<div class="btn-group-sm hidden-xs" id="toolbar" role="group" shiro:hasPermission="system:session:remove">
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" >
		            <i class="fa fa-remove"></i> 删除
		        </a>
	<!--             <a class="btn btn-warning" onclick="$.table.exportExcel()">
		            <i class="fa fa-download"></i> 导出
		        </a> -->
	        </div>
	        
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	
	<div th:include="include :: footer"></div>
	<script th:inline="javascript">
		var prefix = ctx + "system/session";
		var removeFlag = [[${@permission.hasPermi('system:session:remove')}]];
		$(function() {
		    var options = {
		        url: prefix + "/list",
		        cleanUrl: prefix + "/clean",
		        removeUrl: prefix + "/remove",
		        exportUrl: prefix + "/export",
		        sortName: "startTime",
		        sortOrder: "desc",
		        modalName: "会话管理",
		        search: false,
		        showExport: false,
		        escape: true,
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'id',
		            title: '序号'
		        },
		        {
		            field: 'sessionId',
		            title: '会话Id'
		        },
		        {
		            field: 'userName',
		            title: '登录名',
		        },
		        {
		        	field:'ip',
		        	title: '登录地址'
		        },
		        {
		            field: 'startTime',
		            title: '登录时间',
		            sortable: true
		        },
		        {
		            title: '操作',
		            align: 'left',
		            formatter: function(value, row, index) {
		               var actions = [];
		               actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove">踢出</i></a>');
		               return actions.join('');
		         } 
		        }]
		    };
		    $.table.init(options);
		});
		
	</script>
</body>
</html>